package cadenas;

public class Ejercicio06_Capitalize{

  static String cadena1 = "antonio gomez";
  //static char cadena1ArrayChar[] ;
  //static String cadena1ArrayString[] /* = new String[cadena1.length()] */;

  public static void main(String[] args){

    char cadena1ArrayChar[] = new char[cadena1.length()];
    String cadena1ArrayString[] = new String[cadena1.length()];

    for (int i = 0; i < cadena1.length(); i++) {
            cadena1ArrayChar[i] = cadena1.charAt(i);
            cadena1ArrayString[i]= "" + cadena1ArrayChar[i];        
    }

    cadena1ArrayString[0]=cadena1ArrayString[0].toUpperCase();

    for (int i = 0; i < cadena1.length(); i++) {
        if(cadena1ArrayChar[i] == ' '){
            System.out.print(" ");
          System.out.print(cadena1ArrayString[i+1].toUpperCase());
          i++;
        }else{          
          System.out.print(cadena1ArrayString[i]);
        }  
    }
    System.out.println();
    }
}